#define _WIN32_DCOM
#include <windows.h>
#include <iostream.h>
#include "Component\component.h"

void main()
{
	CoInitialize(NULL);

	OLECHAR string[] = L"clsid:10000002-0000-0000-0000-000000000001";

	IClassFactory* pClassFactory;
	CoGetObject(string, 0, IID_IClassFactory, (void**)&pClassFactory);

	ISum* pSum;
	pClassFactory->CreateInstance(NULL, IID_ISum, (void**)&pSum);

	int addition;
	pSum->Sum(23, 32, &addition);
	cout << "23 + 32 = " << addition << endl;

	pSum->Release();
	pClassFactory->Release();

	CoUninitialize();
}